1. Field of the Invention
This invention relates to the field of data and data definition manipulation in a database.
2. Background Art
Database management systems (DBMS) have been developed to address informational needs by providing tools to define the structure of data, and to store and retrieve data. For example, a DBMS provides the ability to structure information into relations, or tables, and to relate tables using key fields.
The structure of the information can be defined using a data definition language. For example, a "Create Table" statement can be used to create a table, name a table, identify the columns in the table, and identify information about each column (e.g., data type, default value, and nullability). Similarly, an alter command can be used to alter the table definition specified by the create table statement.
The data definition language requires considerable expertise to use. A table creation operation is expressed using a syntax that must be correct before the creation operation can be performed. Similarly, an alteration operation requires a statement that must be expressed using the correct syntax.
In addition, an alteration operation requires additional steps to preserve the integrity of the data in the table. For example, an alteration that involves a conversion from one field to a second field that is shorter in length can result in an inability to retain all of the data contained in the field. Thus, to preserve the integrity of the data, the contents of a table must be examined prior to performing an alteration, and the data converted into the new data type.
The facilities of a DBMS are used to store a data definition. A table creation results in the creation of the table, and the inclusion of the data definition in DBMS control tables. Thus, when an alteration operation is performed, the information in the DBMS control tables must also be updated.
Prior art systems that use the capabilities of a DBMS to maintain data (i.e., DBMS application software) can require additional information about a field. Thus, it is desirable to provide the ability to maintain application control tables that contain the information from the DBMS control tables as well as additional information that further defines the application data. For example, a field's (or column's) data type may be stored in the DBMS and application control tables. Therefore, when an alteration operation is specified to alter a field's data type, both the DBMS and application control tables must be altered. Further, each DBMS has different methods for altering SQL tables. Thus, the alteration operation can vary depending on the method of altering SQL tables.